import cn.sofwin.blog.dao.ArticleDao;
import cn.sofwin.blog.entity.Article;
import cn.sofwin.blog.entity.User;
import cn.sofwin.blog.utils.Dbutils;
import org.apache.ibatis.session.SqlSession;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.List;

public class test {
    private ArticleDao articleDao;
    private SqlSession session;

    @Before
    public void init() {
        session = Dbutils.openSession();
        articleDao = session.getMapper(ArticleDao.class);
    }

    @After
    public void destroy() {
        session.commit();
        session.close();
    }
    @Test
    public void  test1(){
        List<Article> list =articleDao.all();
        System.out.println(list);
    }

}
